from config import URL
import requests

class EmpApi(object):
    def __init__(self):
        self.emp_url = URL + '/api/sys/user'
    def add_emp(self,body,au_headers):
        resp = requests.post(self.emp_url,json=body,headers=au_headers)
        return resp
    def query_emp(self,emp_id,au_headers):
        resp = requests.get(self.emp_url + '/'+emp_id,headers=au_headers)
        return resp
    def modify_emp(self,body,emp_id,au_headers):
        resp = requests.put(self.emp_url + '/'+emp_id,json=body,headers=au_headers)
        return resp
    def delete_emp(self,emp_id,au_headers):
        resp = requests.delete(self.emp_url + '/'+emp_id,headers=au_headers)
        return resp